package br.fabrica.conexoes;

import java.io.IOException;
import org.ksoap.SoapObject;
import org.ksoap.transport.HttpTransport;

public class LoginThread extends Thread{

	public void run(String login, String senha){
		String protocolo;
		
		SoapObject requisicao = new SoapObject(ConexaoInfo.getInstance().getUrlWebservice(), "efetuarLogin");
		requisicao.addProperty("login", login);
		requisicao.addProperty("senha", senha);
		
		HttpTransport retorno = new HttpTransport(ConexaoInfo.getInstance().getUrlWebservice(), "efetuarLogin");
		
		try {
			protocolo = (String) retorno.call(requisicao);
			System.out.println("retorno: "+protocolo);
			ConexaoInfo.getInstance().setProtocolo(protocolo);
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}
